<?php

namespace App\Admin\Controllers;
use Dcat\Admin\Grid;
use App\Admin\Repositories\Card as CardRepository;
use Dcat\Admin\Grid\LazyRenderable;


class Card extends LazyRenderable
{
    public function grid(): Grid
    {
        return Grid::make(new CardRepository(), function (Grid $grid) {

            $grid->column('id','ID');
            $grid->column('name','姓名');
            $grid->column('number','卡号');
            $grid->column('bank','银行');
            $grid->column('bank_branch','开户行');
            $grid->paginate(10);
            $grid->disableActions();
            $grid->model()->where('id',  $this->id);
        });
    }
}
